UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZrYbfPV+MDnqNCs8tiLRHUbOJ6V6dScyDAgiueCuDlE='
WHERE
key_id = '7daab9fd25c8ee006dc781aa6572a9d046d0eadf2d3db292d1c80a77b39740cf'
AND (
token = 'ZrYbfPV+MDnqNCs8tiLRHUbOJ6V6dScyDAgiueCuDlE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)