UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7t2A1dIVnDnayNKP/xu2t5RvP90OK9sbZMNwUwibF+E=' 
WHERE 
  key_id = '60797912121ddb232c5aa15accd83c3fe7a4964d6cc846c43b74d7707a546bdb' 
  AND (
    token = '7t2A1dIVnDnayNKP/xu2t5RvP90OK9sbZMNwUwibF+E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025