UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3z3vBLwj6z0+/ME0q8ROX/hAk81mgS0LEmpZpIQnVaI='
WHERE
key_id = 'aac914a76abf9ff7cc0e1c2d711e6cbaf327be3f84909cff1ec0bcf20cedc9e4'
AND (
token = '3z3vBLwj6z0+/ME0q8ROX/hAk81mgS0LEmpZpIQnVaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)