UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ey9gDfim/A0QiYz8HmgZLREA+XnJd1OW8G/W+0fo5g='
WHERE
key_id = '4aba729436661126a04c8e79ef71d94088ffc972c75bef929103768bf28e13ad'
AND (
token = '2ey9gDfim/A0QiYz8HmgZLREA+XnJd1OW8G/W+0fo5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)