UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nVbHnnZhuzkeMpEy+7NpOTlHyFdkn+88iGWOV4KJn8s='
WHERE
key_id = '5b50e00adaf6e93548629eb303043a7937eff96f929ae46f963178aef77d2fe2'
AND (
token = 'nVbHnnZhuzkeMpEy+7NpOTlHyFdkn+88iGWOV4KJn8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)