UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Uk1X89U7hmvMhy3/YNYeE5xsqRmXH1ShZbghWZ77ks='
WHERE
key_id = 'accb5ccd96f1fa139848f5666bcb1191726fd1c0ca1e61da2a905f91a3261512'
AND (
token = '9Uk1X89U7hmvMhy3/YNYeE5xsqRmXH1ShZbghWZ77ks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)