UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GihlOroJPvt6fHpzDa3y9ltLacKqDEmPYUPrEHSJSAE=' 
WHERE 
  key_id = 'e041f1855f0ba840217e1fd940a6cae3ef616f5995c08ae8ff965ee9ccf83af2' 
  AND (
    token = 'GihlOroJPvt6fHpzDa3y9ltLacKqDEmPYUPrEHSJSAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015