UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KAHNuIz0E4b1XpnFgi1b82tw+xYguK0kNkEBzDDit9w='
WHERE
key_id = '208f97a65c9ada71c1043c5d0c5967fe5c93ef9f52580909bd7aa08e6d2dbd74'
AND (
token = 'KAHNuIz0E4b1XpnFgi1b82tw+xYguK0kNkEBzDDit9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)