UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mUZA5QfN+072xIP8IIlYfnki2MxI1LvVC+TisbcL3ig='
WHERE
key_id = '95913b7b5aaedb37c11d7ab0be3eb3914ec2375c3c05440ac2ba8226c61f39c5'
AND (
token = 'mUZA5QfN+072xIP8IIlYfnki2MxI1LvVC+TisbcL3ig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)