UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'va3zYc+y9g4i0k4qdIuwqrfEkX0y8Yt9cMVgFG6gwx8=' 
WHERE 
  key_id = 'd0e01a080e265251b9c5490d2c796a2224a6c66469d5781aacf0ec54fa1e7fee' 
  AND (
    token = 'va3zYc+y9g4i0k4qdIuwqrfEkX0y8Yt9cMVgFG6gwx8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025