UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '61nMSzZiPKzrY6uzW4CJvEL+Ts76M5eRaDaz6gjXMwY='
WHERE
key_id = 'fc202895253b7ef6af110093b1d6c3d0c7d0555ef24d58adffee09387da1a0db'
AND (
token = '61nMSzZiPKzrY6uzW4CJvEL+Ts76M5eRaDaz6gjXMwY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)