UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SyYams8l7KP2JGiuSOYKH/dziQWpoKKraWqTlUY3OHI='
WHERE
key_id = 'f9f617be4a598e5e9edc7e03a8cd74460f5fe8e7c5343efb0f127f74704d07f5'
AND (
token = 'SyYams8l7KP2JGiuSOYKH/dziQWpoKKraWqTlUY3OHI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)