UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'szvGebG1IjWY3Ywzo2RDjthJ0A1A7Fp2ZHIA8wQXxbY='
WHERE
key_id = '39b090a006be24a1fa447a8a8784f53a458220e3fca40093ce3c63abc8c8518f'
AND (
token = 'szvGebG1IjWY3Ywzo2RDjthJ0A1A7Fp2ZHIA8wQXxbY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)