UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QWDsXRt+k4bn/nmNOM+MLeNnLW0L14392/68RdpXgbk='
WHERE
key_id = 'faba7ce62e84a592a0b7608955e989f80b6e1f390c4ba133480a50702172cd96'
AND (
token = 'QWDsXRt+k4bn/nmNOM+MLeNnLW0L14392/68RdpXgbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)