UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4gbu0uOEtPvehXZVzt90c0aR495XjbHn7IdPQuZQg1A='
WHERE
key_id = 'ada2a656f0fefe6f48267a765ef0a495331526975c7ca6279d4779994fc6d2d4'
AND (
token = '4gbu0uOEtPvehXZVzt90c0aR495XjbHn7IdPQuZQg1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)