UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IbeqocqGI4bNzO9a//nXyObOAdu6TxTzfQPWvo38wdY='
WHERE
key_id = 'd6557f5fa631807e9226c7064a3724f85099c6dc657decb3d9ef4cd87e6ff800'
AND (
token = 'IbeqocqGI4bNzO9a//nXyObOAdu6TxTzfQPWvo38wdY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)