UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xPjHWJfPZenQ7hTEWb4IHKFdrHpGMv46xPltSBWgggQ='
WHERE
key_id = '52173d271795995fe1a29b434f997b442532a1b040aef688ae71f76591604730'
AND (
token = 'xPjHWJfPZenQ7hTEWb4IHKFdrHpGMv46xPltSBWgggQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)