UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1iv5+uf6BPXV2ANR72/4zCVai2NIl6sjPtCBuvFousg='
WHERE
key_id = '6e9310e539c58bdffc95a94768cdaeb15faa9ad8ff0f7951d5c2ad583f148be3'
AND (
token = '1iv5+uf6BPXV2ANR72/4zCVai2NIl6sjPtCBuvFousg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)