UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tJ3yua5YZepxk/ajyq2b1oIRQ4mnKRYefakuCqGv+4I='
WHERE
key_id = '6e80d45d0c039f384fc51217cd0b04ab2bc0b6d8b7e6ceb94502d27685943fde'
AND (
token = 'tJ3yua5YZepxk/ajyq2b1oIRQ4mnKRYefakuCqGv+4I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)