UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xoZAPjEqh5Etavtakthqif9DYUQhi8tra3tydP55JFQ='
WHERE
key_id = '20f01d15e1b8be68968bcd83dac1b2aaaf824082e56f57633c7a0d85c02b52d5'
AND (
token = 'xoZAPjEqh5Etavtakthqif9DYUQhi8tra3tydP55JFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)