UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X8JaFqws/KkFWGoT39QCWkqho1NcysPG8kuHNjg0EZw=' 
WHERE 
  key_id = '7eeb911ac54e27f6a31d36a1d1c4e66adc6ea2b16d8b040b1e1ad009b8669f3e' 
  AND (
    token = 'X8JaFqws/KkFWGoT39QCWkqho1NcysPG8kuHNjg0EZw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023