UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kyo/XKDti9Pp2mXGazwJ7CcEQy6+o3d4ADxZY5LdkwA='
WHERE
key_id = '5d3769c04fddf2037cb1791770cffca1765da42c9e33c85d158074168164f0ec'
AND (
token = 'kyo/XKDti9Pp2mXGazwJ7CcEQy6+o3d4ADxZY5LdkwA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)