UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iLeoakxraBAOkCWJYzubloKYSw7wZqXQ4VZ3wYSn1IM=' 
WHERE 
  key_id = '6bc9d2753a82c68c36b7f1fc9bfedeee77a48881ee40d437bec6faff1ea661cb' 
  AND (
    token = 'iLeoakxraBAOkCWJYzubloKYSw7wZqXQ4VZ3wYSn1IM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051