UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3fTjCpaSyUciSeeT5hew4NL5YOTZaTWDTqTpUYYkUC4=' 
WHERE 
  key_id = '727ddcac7f28dac849fd2c77fb2a2d3f2355ed7ad29c5202d37c73caac5cda2c' 
  AND (
    token = '3fTjCpaSyUciSeeT5hew4NL5YOTZaTWDTqTpUYYkUC4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029