UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AQldmkgGtX/6z6JNK1WIoxm9sIviA72KolxnH5mPYPM=' 
WHERE 
  key_id = 'dd3960484a40237e16a3ba1aab9b77cb9df0de74e1229ae9d0d556ae096bc89b' 
  AND (
    token = 'AQldmkgGtX/6z6JNK1WIoxm9sIviA72KolxnH5mPYPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018