UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JIxDgX2b+Qupfzm5hGnP8bjCUc1vLV56d7WBu2zqro0=' 
WHERE 
  key_id = '1836ac01d0e99a4f57b3f37dd0fda4cf5590a7736e46a201ae5557c393dca339' 
  AND (
    token = 'JIxDgX2b+Qupfzm5hGnP8bjCUc1vLV56d7WBu2zqro0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029