UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '65Q8AjXQzCmllKRa+lKJ7XZZwcHv+BYVRYT+gb1h/S4='
WHERE
key_id = '4422a198ee06f534d3a17c192b4307c80e630d55da89c66517e42f128fa4cc61'
AND (
token = '65Q8AjXQzCmllKRa+lKJ7XZZwcHv+BYVRYT+gb1h/S4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)