UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mcdF/XLunnekMqpHaxy4xzJlmPvFWG+NEngtBwuKGSc='
WHERE
key_id = '205aeea4dea28c50315c3ba10913ac1cf251cfaacd0014e65898de25ad61c003'
AND (
token = 'mcdF/XLunnekMqpHaxy4xzJlmPvFWG+NEngtBwuKGSc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)