UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U33a7jUQLYm8vvZVnCbm0IE1qbtCUCOF/s4d3K3h4nY='
WHERE
key_id = '9b2d685d4f8afcfb9306ecb0b99939ca9cb434e2b89e088cc5bd933da5780c96'
AND (
token = 'U33a7jUQLYm8vvZVnCbm0IE1qbtCUCOF/s4d3K3h4nY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)