UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8zZUwfksShZb9Qbb7rFWsGZE3sJyLohpR4/o2v++HTM='
WHERE
key_id = '168ab6ec1f07f5a0256d0572e2a4fba3ab2f8f129272914e51885d453b95c557'
AND (
token = '8zZUwfksShZb9Qbb7rFWsGZE3sJyLohpR4/o2v++HTM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)