UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YJSHyU958dMnBzfzYaKi5b0yg4JnHdzqTWP7OstyF/8=' 
WHERE 
  key_id = '0dbf4a3496bc06df1054d924495e27fe28d2293415552f053bea6178ac535610' 
  AND (
    token = 'YJSHyU958dMnBzfzYaKi5b0yg4JnHdzqTWP7OstyF/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014