UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tl3xvX3QgEySsf1ycghG+n86JLWyivmtMaWkf9qyJaI='
WHERE
key_id = '2ed8bf894c1485eb9d199dbffde0b596959068c5996ec996635c61f5f4f32c86'
AND (
token = 'Tl3xvX3QgEySsf1ycghG+n86JLWyivmtMaWkf9qyJaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)