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

Query time 0.00056