UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cp7Jw+KRMeJ1Xp3nyc+BdtXRG2aTVU/6/3MNFDFG2Ng='
WHERE
key_id = '9794ed12bd30a0a1c32f3c7527ebf1631d44288cd24bcfc4abe8c3e07437f5e7'
AND (
token = 'cp7Jw+KRMeJ1Xp3nyc+BdtXRG2aTVU/6/3MNFDFG2Ng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)