UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aoZOx5ApMPUtjcleVT+oIgUQz5wHtnw0rRXRkIPL0Fs=' 
WHERE 
  key_id = 'f8c667d92856554de925de682cf8721473813e009301ef1f593400fc32df1e56' 
  AND (
    token = 'aoZOx5ApMPUtjcleVT+oIgUQz5wHtnw0rRXRkIPL0Fs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019