UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'POUsm+afa6G5wF+nIYHRlKko1cNdmTg5/gFOERqfGng=' 
WHERE 
  key_id = 'f2064a0f3956e79b819f93a526db10b8a59df3017c50f67fe9807f46779c0566' 
  AND (
    token = 'POUsm+afa6G5wF+nIYHRlKko1cNdmTg5/gFOERqfGng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021