UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sGUSSdFeFvnOwtYHXH8mIIsQZXmiDQ571PsX2m1kg3s='
WHERE
key_id = '86d6afa7295aaf9cc12f8f3fb6b847e9acf2ddc1dce40fa696213a71cb376994'
AND (
token = 'sGUSSdFeFvnOwtYHXH8mIIsQZXmiDQ571PsX2m1kg3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)