UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WO/zG5iwoOGP2pdl8o9k5A+mgIyGB/pzCRBi2UTO8EU='
WHERE
key_id = 'a211306eb8ea4816e6704b2ff70df05e379700ac79531ff894b01c4c2b7da233'
AND (
token = 'WO/zG5iwoOGP2pdl8o9k5A+mgIyGB/pzCRBi2UTO8EU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)