UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4gN2H5y/g9AEkiy9yNmWcOrOKi6r3SfWghCjI+ICnDY='
WHERE
key_id = '5fe2c3f6b4d7ad8014813b03e04a5450c9bf341f9184641f361a1c4ed977749a'
AND (
token = '4gN2H5y/g9AEkiy9yNmWcOrOKi6r3SfWghCjI+ICnDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)