UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7iZGeiUGQgHSG277Z8lPMd0vSv6P0np7WWN6Xv1diRM='
WHERE
key_id = '8ebf760686a225bac845127bd7a39bb4b73b971a7c1d9b61d3a2bd46c61ab6d6'
AND (
token = '7iZGeiUGQgHSG277Z8lPMd0vSv6P0np7WWN6Xv1diRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)