UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2f9sA0T/0mwTUl//B+ZVnNfoTrm5SNYz8Xu5wvPEMss='
WHERE
key_id = '46027e01a3c0906b88dfc7cde264ca164fc4bc774dc2ad4cd63fcd2c5dca88b7'
AND (
token = '2f9sA0T/0mwTUl//B+ZVnNfoTrm5SNYz8Xu5wvPEMss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)