UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PJg9QI/FbmNuvY5N/k4VaCtkw1z9ojOK6w9uOdZJ/6k='
WHERE
key_id = 'a8cada3e0882304cf48390718fbdb054d5a1abb7972e06966a13f86556be4ba6'
AND (
token = 'PJg9QI/FbmNuvY5N/k4VaCtkw1z9ojOK6w9uOdZJ/6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)