UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2NN+NIekx4zpxHuJFB9vh49fhv913XfLsuCQgAGprpw='
WHERE
key_id = 'b03fb956de29936216734f5f6ae456ca45c0e07c6effb535902d0194cbc8ec10'
AND (
token = '2NN+NIekx4zpxHuJFB9vh49fhv913XfLsuCQgAGprpw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)