UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kxe5rkEkTNnaxleRq023PkJK1H77j3nai5tZp86STSs='
WHERE
key_id = 'f03335600d7ccb3b6c09cdcea937e3de36403a151e2dadca83b02f028e8b50f0'
AND (
token = 'kxe5rkEkTNnaxleRq023PkJK1H77j3nai5tZp86STSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)