UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Gu7+AfUhU1lNjcx8aW/VlC+KCTsmYkJLSuTF0K5m4s=' 
WHERE 
  key_id = '0d224846a32f9d94b29743ccbef1c50c205fe4b9a93c00832407202871caf368' 
  AND (
    token = '2Gu7+AfUhU1lNjcx8aW/VlC+KCTsmYkJLSuTF0K5m4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032