UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+jLZG+ZqUj1m179yIbwKsfkSN1eIXZve2rjUHF4UQhA=' 
WHERE 
  key_id = '5d3a64de6a121830d619f11196eee17d245b806ceea111e62bec0fea64a64e38' 
  AND (
    token = '+jLZG+ZqUj1m179yIbwKsfkSN1eIXZve2rjUHF4UQhA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022