UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mYcCEwF2DkcPq2k1v37YE+NLPHZzuaJY3pf0n8jZwHY='
WHERE
key_id = 'be09c393c02590f56dc065fabfa76dff1b50b68f499547e3b4507dcef25c302c'
AND (
token = 'mYcCEwF2DkcPq2k1v37YE+NLPHZzuaJY3pf0n8jZwHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)