UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jssg7SNSGGJqCfBZhWZTRODljXhs16I6q7u9Wu5lShU='
WHERE
key_id = 'ec35ebf93ea69b163318e6b80e359981eaced77d333fd5f2131013bcd1d90480'
AND (
token = 'jssg7SNSGGJqCfBZhWZTRODljXhs16I6q7u9Wu5lShU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)