UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AUAWLttV8MH5Emp/dQW05JinB6sqOXkzMbTiLwXkdlc=' 
WHERE 
  key_id = 'cf22c2756c8f00e77c140a7527f145ea1d09614f3af6f2e63c66898c47eba27a' 
  AND (
    token = 'AUAWLttV8MH5Emp/dQW05JinB6sqOXkzMbTiLwXkdlc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038