UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HtwTssw64sEaJK3wiiIIKrFtXnxbpmwMAXd633QhL2c='
WHERE
key_id = '8663a5f810b044a26cae064398e6dd0caa10cb92b69f6ab2edb5e9f2f80e5bf7'
AND (
token = 'HtwTssw64sEaJK3wiiIIKrFtXnxbpmwMAXd633QhL2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)